package cn.pugle.base;

import java.util.ArrayList;

/**
 * @author tzp
 * @since 2018/2/5
 */
public class InstanceOfTest {
    public static void main(String[] args) {
        String s=new String("javaisland");
        Class<String> stringClass = String.class;

        System.out.println(s instanceof String);
        System.out.println(stringClass.isInstance(s));
        System.out.println(ArrayList.class.isAssignableFrom(Object.class));  //false
        System.out.println(Object.class.isAssignableFrom(ArrayList.class));  //true
    }
}
